// https://www.acwing.com/problem/content/842/

#include <iostream>
#include <cstring>

using namespace std;

// 开放寻址法

const int MOD = 200003;
const int EMPTY = 0x3F3F3F3F;

// 所有的槽
int h[MOD];

int Find(int x) {
    int k = (x % MOD + MOD) % MOD;
    while (h[k] != EMPTY && h[k] != x) {
        k++;
        if (k == MOD) {
            k = 0;
        }
    }
    return k;
}


int main() {
    int n, tmp;
    char op[2];
    scanf("%d", &n);
    memset(h, EMPTY, sizeof h);
    while (n-->0) {
        scanf("%s%d", op, &tmp);
        int k = Find(tmp);
        if (*op == 'I') {
            h[k] = tmp;
        } else if (*op == 'Q') {
            if (h[k] != EMPTY) {
                cout<<"Yes"<<endl;
            } else {
                cout<<"No"<<endl;
            }
        }
    }
    return 0;
}
